/**
 * Created by zlj on 2016/11/6
 */
require('libs/validator');
var $ = require('jquery');
//opt 对象 ，rule 规则 ,msg对应显示信息
 module.exports = function(opt,rule,msg,callback) {
    var theform = $(opt.selector);
    var btn = theform.find('#submit_form');
    var action = theform.attr('action');
     var validate =  theform.validate({
        rules:rule,
        messages:msg,
        submitHandler: function() {
            callback();
        }
    });

};